rvlib-shipkit 2.31.0 → 2.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (408) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/package.json +1 -1
  3. package/src/advisors/acts.ts +16 -15
  4. package/src/advisors/advice.ts +56 -102
  5. package/src/advisors/advisor-view.ts +122 -76
  6. package/src/advisors/app-graph.ts +1 -1
  7. package/src/advisors/app.ts +3 -11
  8. package/src/advisors/cf-api.ts +1 -1
  9. package/src/advisors/dir-bucket.ts +4 -3
  10. package/src/advisors/edge/api.ts +20 -221
  11. package/src/advisors/edge/bucket.ts +2 -2
  12. package/src/advisors/edge/handler.ts +13 -155
  13. package/src/advisors/edge/here.ts +5 -5
  14. package/src/advisors/edge/pages.ts +12 -9
  15. package/src/advisors/edge/shell.ts +6 -5
  16. package/src/advisors/edge/sign-in.ts +101 -36
  17. package/src/advisors/edge/status.ts +19 -6
  18. package/src/advisors/edge/types.ts +36 -60
  19. package/src/advisors/expose.ts +29 -29
  20. package/src/advisors/here.ts +12 -12
  21. package/src/advisors/invite-send.ts +79 -35
  22. package/src/advisors/invite.ts +31 -8
  23. package/src/advisors/job.ts +24 -16
  24. package/src/advisors/login.ts +40 -15
  25. package/src/advisors/owner-store.ts +46 -22
  26. package/src/advisors/photos.ts +3 -3
  27. package/src/advisors/project.ts +27 -25
  28. package/src/advisors/reach.ts +89 -0
  29. package/src/advisors/rights.ts +1 -1
  30. package/src/advisors/routes.ts +55 -74
  31. package/src/advisors/scan.ts +0 -4
  32. package/src/advisors/setup-run.ts +14 -14
  33. package/src/advisors/share-trace.ts +3 -3
  34. package/src/advisors/{door-probe.ts → sign-in-probe.ts} +7 -6
  35. package/src/advisors/speaks.ts +29 -0
  36. package/src/advisors/sync.ts +97 -183
  37. package/src/advisors/tunnel.ts +6 -5
  38. package/src/advisors/users-listen.ts +92 -0
  39. package/src/advisors/users-router.ts +261 -87
  40. package/src/advisors/users-store.ts +81 -0
  41. package/src/agent-time/blocked-scan.ts +181 -0
  42. package/src/agent-time/registry.ts +12 -5
  43. package/src/agent-time/store.ts +9 -109
  44. package/src/asks/ask-bar-fold.ts +2 -1
  45. package/src/asks/ask-close.ts +2 -1
  46. package/src/asks/ask-doc.ts +2 -1
  47. package/src/asks/ask-migrate.ts +3 -2
  48. package/src/asks/ask-steps-fold.ts +2 -1
  49. package/src/asks/ask-store.ts +4 -3
  50. package/src/check.ts +3 -43
  51. package/src/checks/SK001-package-json-shape.check.ts +4 -55
  52. package/src/checks/SK004-gitignore-policy.check.ts +24 -69
  53. package/src/checks/SK013-one-way-in-policy.check.ts +3 -7
  54. package/src/checks/SK017-vscode-hub-task.check.ts +4 -4
  55. package/src/checks/SK019-tests-run-in-units.check.ts +3 -14
  56. package/src/checks/SK020-self-spawning-check.check.ts +5 -7
  57. package/src/checks/SK035-public-clean.check.ts +1 -1
  58. package/src/checks/SK039-vscode-watch-generated.check.ts +1 -1
  59. package/src/checks/SK042-post-kinds.check.ts +5 -14
  60. package/src/checks/SK054-agent-allow-list.check.ts +5 -74
  61. package/src/checks/SK055-retired-config-keys.check.ts +45 -0
  62. package/src/cli/cmd_Advisors.ts +11 -45
  63. package/src/cli/cmd_Asks.ts +3 -10
  64. package/src/cli/cmd_Backup.ts +25 -127
  65. package/src/cli/cmd_BackupTargets.ts +1 -1
  66. package/src/cli/cmd_Capacity.ts +6 -2
  67. package/src/cli/cmd_Checks.ts +0 -14
  68. package/src/cli/cmd_Ci.ts +2 -1
  69. package/src/cli/cmd_Db.ts +3 -82
  70. package/src/cli/cmd_Home.ts +4 -32
  71. package/src/cli/cmd_Hq.ts +0 -17
  72. package/src/cli/cmd_Releases.ts +57 -4
  73. package/src/cli/cmd_Review.ts +333 -354
  74. package/src/cli/cmd_Shot.ts +26 -4
  75. package/src/cli/cmd_SocialDrafts.ts +6 -13
  76. package/src/cli/cmd_ThreadSyncNeeds.ts +6 -2
  77. package/src/cli/cmd_Time.ts +1 -1
  78. package/src/cli/cmd_Trailer.ts +1 -1
  79. package/src/cli/inbox-hook-run.ts +5 -23
  80. package/src/cli/registry-heads.ts +5 -55
  81. package/src/cli/registry.ts +1 -5
  82. package/src/cli/review-here.ts +1 -1
  83. package/src/cli.ts +15 -4
  84. package/src/collections/collection-types.ts +1 -1
  85. package/src/collections/review.ts +5 -4
  86. package/src/core/admission.ts +268 -0
  87. package/src/core/agent-allow-policy.ts +32 -2
  88. package/src/core/agent-env.ts +8 -0
  89. package/src/core/allow-rows.ts +74 -0
  90. package/src/core/check-file-names.ts +19 -106
  91. package/src/core/code-lines.ts +36 -21
  92. package/src/core/footprint.ts +17 -13
  93. package/src/core/identities-root.ts +1 -4
  94. package/src/core/layout.ts +1 -2
  95. package/src/core/machine-db.ts +33 -208
  96. package/src/core/machine-layout.ts +14 -127
  97. package/src/core/machine-read.ts +5 -2
  98. package/src/core/mask-source.ts +60 -0
  99. package/src/core/memory-watch.ts +17 -14
  100. package/src/core/motherhome.ts +8 -35
  101. package/src/core/one-way-in-policy.ts +0 -3
  102. package/src/core/peer-sk.ts +8 -0
  103. package/src/core/repo-walk.ts +0 -9
  104. package/src/core/retention.ts +1 -9
  105. package/src/core/retired-checks.ts +2 -0
  106. package/src/core/tmux-policy.ts +1 -1
  107. package/src/core/tree-watch.ts +2 -2
  108. package/src/core/when.ts +7 -45
  109. package/src/gate/admit-heavy.ts +150 -0
  110. package/src/gate/check-runner.ts +6 -0
  111. package/src/gate/discover-checks.ts +42 -32
  112. package/src/gate/gate-checks.ts +21 -131
  113. package/src/gate/head-gate.ts +1 -1
  114. package/src/gate/job-run.ts +2 -1
  115. package/src/gate/pre-commit-discovery.ts +22 -28
  116. package/src/gate/run-check.ts +3 -4
  117. package/src/gate/run-ci.ts +4 -0
  118. package/src/gate/run-fix.ts +5 -17
  119. package/src/gate/run-fixers.ts +6 -42
  120. package/src/home/app-sign.ts +2 -2
  121. package/src/home/backup-status.ts +52 -92
  122. package/src/home/backup-verdict.ts +2 -2
  123. package/src/home/daemon-jobs.ts +51 -95
  124. package/src/home/database-words.ts +1 -2
  125. package/src/home/databases.ts +9 -25
  126. package/src/home/home-launchd.ts +0 -6
  127. package/src/home/home-paths.ts +8 -4
  128. package/src/home/home-routes.ts +3 -10
  129. package/src/home/home-state.ts +2 -14
  130. package/src/home/inbox-shape.ts +14 -15
  131. package/src/home/inbox.ts +1 -1
  132. package/src/home/machine-repair.ts +102 -103
  133. package/src/home/resume.ts +1 -15
  134. package/src/home/run-daemon.ts +7 -12
  135. package/src/home/space-page.ts +3 -2
  136. package/src/home/supervise.ts +3 -7
  137. package/src/hooks/commit-msg-run.ts +61 -0
  138. package/src/hooks/commit-run.ts +16 -166
  139. package/src/hooks/gate-outcome.ts +108 -0
  140. package/src/hooks/git-hook.ts +9 -9
  141. package/src/hooks/hook-config.ts +8 -8
  142. package/src/hooks/leak-guard.ts +1 -1
  143. package/src/hooks/pre-commit-checks.ts +1 -1
  144. package/src/hooks/run-hooks.ts +2 -6
  145. package/src/hooks/shared-file.ts +3 -2
  146. package/src/hq/daemon-db.ts +8 -8
  147. package/src/hq/door.ts +3 -16
  148. package/src/hq/hq-db.ts +4 -3
  149. package/src/hq/hq-local.ts +1 -2
  150. package/src/hq/hq-store.ts +0 -15
  151. package/src/hq/item-direct.ts +8 -10
  152. package/src/hq/item-fill.ts +37 -0
  153. package/src/hq/kinds/item-gone.ts +7 -10
  154. package/src/hq/kinds/item-msg.ts +12 -18
  155. package/src/hq/kinds/item.ts +13 -19
  156. package/src/hq/kinds/report.ts +3 -4
  157. package/src/hq/owner-switch.ts +3 -3
  158. package/src/hq/report.ts +5 -9
  159. package/src/hq/switch.ts +2 -11
  160. package/src/hq/thread-sync.ts +5 -17
  161. package/src/hq/{shapes-words.ts → threads-words.ts} +2 -12
  162. package/src/http/owner-word.ts +1 -1
  163. package/src/identities/machine.ts +16 -0
  164. package/src/init-repo.ts +0 -1
  165. package/src/ledger/check-stats.ts +6 -5
  166. package/src/ledger/db.ts +2 -4
  167. package/src/ledger/record-kept.ts +117 -48
  168. package/src/ledger/run-log.ts +21 -2
  169. package/src/ledger/slow-tests.ts +96 -0
  170. package/src/ledger/store.ts +3 -86
  171. package/src/ledger/suite-log.ts +8 -2
  172. package/src/media-store/backup/facts.ts +3 -37
  173. package/src/media-store/backup/keys.ts +1 -8
  174. package/src/media-store/backup/manifest.ts +6 -67
  175. package/src/media-store/backup/restore.ts +4 -13
  176. package/src/media-store/backup/retention.ts +13 -1
  177. package/src/media-store/backup/run.ts +6 -267
  178. package/src/media-store/backup/snapshot.ts +2 -38
  179. package/src/media-store/backup/sources.ts +3 -113
  180. package/src/media-store/backup/target-send.ts +5 -29
  181. package/src/media-store/db.ts +8 -7
  182. package/src/media-store/forget-one.ts +1 -1
  183. package/src/media-store/forget.ts +1 -80
  184. package/src/orchestrator/guards.ts +0 -1
  185. package/src/orchestrator/presence.ts +2 -2
  186. package/src/orchestrator/routes.ts +1 -1
  187. package/src/orchestrator/started.ts +0 -9
  188. package/src/orchestrator/talk-key.ts +3 -4
  189. package/src/orchestrator/unheard.ts +1 -1
  190. package/src/plan/planner.ts +3 -2
  191. package/src/recordings/edit.ts +3 -3
  192. package/src/recordings/marks-draw.ts +17 -6
  193. package/src/recordings/marks.ts +120 -9
  194. package/src/reflections/reflections-queue.ts +3 -10
  195. package/src/release/notes.ts +1 -1
  196. package/src/release/public-clean.ts +66 -6
  197. package/src/release/run-bump.ts +11 -0
  198. package/src/release/run-release.ts +4 -0
  199. package/src/releases/from-thread.ts +3 -3
  200. package/src/releases/model.ts +186 -36
  201. package/src/releases/store.ts +13 -3
  202. package/src/releases/validate.ts +83 -0
  203. package/src/repo-config.ts +36 -64
  204. package/src/review/answer-kinds.ts +63 -4
  205. package/src/review/blocked-guard.ts +11 -0
  206. package/src/review/blocked-object.ts +298 -0
  207. package/src/review/cells.ts +144 -230
  208. package/src/review/close.ts +39 -1
  209. package/src/review/doc-save.ts +3 -2
  210. package/src/review/draft-item.ts +1 -1
  211. package/src/review/events.ts +3 -7
  212. package/src/review/expect.ts +23 -39
  213. package/src/review/format.ts +79 -46
  214. package/src/review/glyphs.ts +1 -0
  215. package/src/review/hand-over.ts +3 -3
  216. package/src/review/heard.ts +1 -1
  217. package/src/review/holds-sync.ts +2 -1
  218. package/src/review/inbox-hook.ts +2 -2
  219. package/src/review/inbox-read.ts +39 -33
  220. package/src/review/instruction-guards.ts +12 -0
  221. package/src/review/instructions.ts +0 -1
  222. package/src/review/item-db.ts +13 -43
  223. package/src/review/item-hq.ts +2 -2
  224. package/src/review/item-rows.ts +3 -14
  225. package/src/review/kind-catalog.ts +3 -1
  226. package/src/review/kinds.ts +18 -8
  227. package/src/review/live-view.ts +3 -0
  228. package/src/review/media-kind.ts +1 -1
  229. package/src/review/mentions.ts +1 -2
  230. package/src/review/model.ts +158 -114
  231. package/src/review/move.ts +149 -0
  232. package/src/review/need-threads.ts +3 -2
  233. package/src/review/object-card.ts +11 -0
  234. package/src/review/object-read.ts +6 -1
  235. package/src/review/one-block.ts +1 -1
  236. package/src/review/owner-read.ts +1 -1
  237. package/src/review/phone-push.ts +10 -9
  238. package/src/review/previews.ts +32 -4
  239. package/src/review/push.ts +2 -2
  240. package/src/review/recap.ts +129 -0
  241. package/src/review/referring.ts +6 -3
  242. package/src/review/reflection-object.ts +4 -3
  243. package/src/review/routes.ts +51 -47
  244. package/src/review/secret-route.ts +3 -2
  245. package/src/review/settle.ts +0 -6
  246. package/src/review/snooze.ts +5 -3
  247. package/src/review/speaker.ts +68 -0
  248. package/src/review/start-title.ts +19 -0
  249. package/src/review/store-parties.ts +28 -0
  250. package/src/review/store.ts +94 -59
  251. package/src/review/{wakes.ts → thread-events.ts} +92 -7
  252. package/src/review/thread-md.ts +35 -14
  253. package/src/review/thread-state.ts +804 -0
  254. package/src/review/threads.ts +29 -347
  255. package/src/review/traces.ts +104 -7
  256. package/src/review/trailer-item.ts +1 -1
  257. package/src/review/unit.ts +7 -9
  258. package/src/review/verdict-items.ts +12 -10
  259. package/src/review/view-layout.ts +25 -1
  260. package/src/review/watch-feed.ts +1 -2
  261. package/src/review/working-guards.ts +2 -3
  262. package/src/rules/untrack-generated.ts +1 -15
  263. package/src/secrets/copy.ts +4 -4
  264. package/src/secrets/lapse.ts +2 -1
  265. package/src/serve/hub-app/advisor-app.tsx +4 -4
  266. package/src/serve/hub-app/advisor-face.tsx +9 -3
  267. package/src/serve/hub-app/advisor-host.ts +27 -27
  268. package/src/serve/hub-app/advisors-model.ts +17 -8
  269. package/src/serve/hub-app/advisors-rights.tsx +1 -1
  270. package/src/serve/hub-app/advisors-st.ts +15 -14
  271. package/src/serve/hub-app/advisors-view.tsx +13 -11
  272. package/src/serve/hub-app/app-bridge.ts +23 -3
  273. package/src/serve/hub-app/asks-page.tsx +1 -1
  274. package/src/serve/hub-app/auto-text.tsx +71 -16
  275. package/src/serve/hub-app/check-view.tsx +0 -8
  276. package/src/serve/hub-app/controls.css +14 -3
  277. package/src/serve/hub-app/database-view.tsx +1 -2
  278. package/src/serve/hub-app/dock-st.ts +1 -1
  279. package/src/serve/hub-app/git-view.tsx +3 -1
  280. package/src/serve/hub-app/hub.css +12 -5
  281. package/src/serve/hub-app/icons.tsx +1 -1
  282. package/src/serve/hub-app/inbox-view.tsx +1 -2
  283. package/src/serve/hub-app/live-sources.ts +2 -2
  284. package/src/serve/hub-app/main-panel.tsx +2 -1
  285. package/src/serve/hub-app/panel-repo.ts +0 -9
  286. package/src/serve/hub-app/pic.tsx +29 -12
  287. package/src/serve/hub-app/polled.ts +16 -2
  288. package/src/serve/hub-app/recordings-st.ts +23 -2
  289. package/src/serve/hub-app/recordings-view.tsx +68 -10
  290. package/src/serve/hub-app/ref-pill.ts +1 -1
  291. package/src/serve/hub-app/repo-st.ts +1 -2
  292. package/src/serve/hub-app/review/advisor-add.tsx +1 -1
  293. package/src/serve/hub-app/review/advisor-invite.tsx +1 -1
  294. package/src/serve/hub-app/review/draft-body.tsx +2 -2
  295. package/src/serve/hub-app/review/heard-line.tsx +1 -1
  296. package/src/serve/hub-app/review/instructions-view.tsx +1 -8
  297. package/src/serve/hub-app/review/kind-states.tsx +14 -9
  298. package/src/serve/hub-app/review/kit.tsx +4 -11
  299. package/src/serve/hub-app/review/lane-bar.tsx +3 -3
  300. package/src/serve/hub-app/review/lightbox.tsx +15 -11
  301. package/src/serve/hub-app/review/line-window.ts +4 -1
  302. package/src/serve/hub-app/review/live-bar-st.ts +2 -2
  303. package/src/serve/hub-app/review/live-view.tsx +57 -1
  304. package/src/serve/hub-app/review/object-panel.tsx +20 -8
  305. package/src/serve/hub-app/review/question-views.tsx +191 -53
  306. package/src/serve/hub-app/review/recap-bar.tsx +40 -0
  307. package/src/serve/hub-app/review/request-cell.tsx +48 -0
  308. package/src/serve/hub-app/review/review-cells.tsx +154 -96
  309. package/src/serve/hub-app/review/review-host.ts +8 -4
  310. package/src/serve/hub-app/review/review-kit.ts +17 -11
  311. package/src/serve/hub-app/review/review-list.tsx +30 -35
  312. package/src/serve/hub-app/review/review-st.ts +32 -42
  313. package/src/serve/hub-app/review/review-thread.tsx +139 -85
  314. package/src/serve/hub-app/review/review-views.tsx +127 -68
  315. package/src/serve/hub-app/review/share-lines.tsx +4 -4
  316. package/src/serve/hub-app/review/start-st.ts +2 -5
  317. package/src/serve/hub-app/review/superseded-runs.ts +4 -3
  318. package/src/serve/hub-app/review/thread-close.tsx +10 -7
  319. package/src/serve/hub-app/review/thread-st.ts +381 -202
  320. package/src/serve/hub-app/review/tone-bar.tsx +129 -0
  321. package/src/serve/hub-app/review/tones.ts +53 -0
  322. package/src/serve/hub-app/review/trailer-body.tsx +2 -2
  323. package/src/serve/hub-app/review/trailer-st.ts +3 -2
  324. package/src/serve/hub-app/review/trailer-voices-st.ts +3 -2
  325. package/src/serve/hub-app/review.css +189 -106
  326. package/src/serve/hub-app/search-view.tsx +1 -1
  327. package/src/serve/hub-app/social/social-model.ts +0 -4
  328. package/src/serve/hub-app/source-acts.ts +2 -1
  329. package/src/serve/hub-app/stores/stores-page.tsx +2 -2
  330. package/src/serve/hub-app/terminal-sources.tsx +2 -1
  331. package/src/serve/hub-app/thread-row.tsx +3 -4
  332. package/src/serve/hub-app/tree-build.ts +0 -4
  333. package/src/serve/hub-app/urls-view.tsx +2 -1
  334. package/src/serve/hub-app/view-layout.css +13 -3
  335. package/src/serve/hub-app/wikis-view.tsx +5 -2
  336. package/src/serve/hub-runtime.ts +7 -37
  337. package/src/serve/project-gutter-route.ts +6 -2
  338. package/src/serve/read-thread.ts +20 -2
  339. package/src/serve/read-worker.ts +9 -1
  340. package/src/serve/record-pages.ts +46 -0
  341. package/src/serve/serve-hub.ts +2 -2
  342. package/src/serve/terminal-host.ts +1 -1
  343. package/src/serve/terminal-route.ts +1 -3
  344. package/src/serve/tracked-watch.ts +1 -3
  345. package/src/setup-house.ts +2 -2
  346. package/src/shipkit-files.ts +1 -1
  347. package/src/shipkit.ts +1 -6
  348. package/src/shot/client.ts +2 -1
  349. package/src/shot/film-box.ts +0 -20
  350. package/src/shot/on-place.ts +141 -0
  351. package/src/social/drafts.ts +1 -1
  352. package/src/social/kinds.ts +6 -29
  353. package/src/social/load.ts +2 -2
  354. package/src/social/post-object.ts +3 -2
  355. package/src/social/release-stage.ts +1 -1
  356. package/src/social/stage.ts +2 -2
  357. package/src/stores/model.ts +4 -0
  358. package/src/stores/routes.ts +11 -3
  359. package/src/suite/judge-suites.ts +58 -0
  360. package/src/suite/red-alone.ts +54 -18
  361. package/src/suite/runner-shapes.ts +2 -2
  362. package/src/suite/suite-cli.ts +67 -14
  363. package/src/suite/test-units.ts +2 -1
  364. package/src/urls/fill.ts +1 -1
  365. package/src/urls/places.ts +1 -2
  366. package/src/vault/vault-config.ts +2 -2
  367. package/src/vault/vault-init.ts +1 -5
  368. package/src/wiki/graph-page.ts +14 -2
  369. package/src/advisors/copy-truth.ts +0 -49
  370. package/src/advisors/door-child.ts +0 -112
  371. package/src/advisors/door-serve.ts +0 -52
  372. package/src/advisors/door.ts +0 -118
  373. package/src/checks/SK016-legacy-check-shapes.check.ts +0 -189
  374. package/src/checks/SK029-explicit-check-files.check.ts +0 -112
  375. package/src/checks/SK048-one-local-file.check.ts +0 -36
  376. package/src/core/config-rewrite.ts +0 -111
  377. package/src/core/daemon-port.ts +0 -10
  378. package/src/core/legacy-shapes.ts +0 -263
  379. package/src/core/migrate-layout.ts +0 -638
  380. package/src/core/port-check-cli.ts +0 -52
  381. package/src/core/port-check-file.ts +0 -295
  382. package/src/core/port-check-files.ts +0 -31
  383. package/src/gate/discover-legacy-checks.ts +0 -26
  384. package/src/home/home-move.ts +0 -527
  385. package/src/home/machine-fold.ts +0 -810
  386. package/src/hq/item-shapes.ts +0 -54
  387. package/src/hq/kinds/items-read.ts +0 -4
  388. package/src/media-store/backup/daemon.ts +0 -220
  389. package/src/media-store/backup/kept.ts +0 -241
  390. package/src/media-store/backup/prune.ts +0 -359
  391. package/src/media-store/backup/secret.ts +0 -88
  392. package/src/media-store/backup/ssh-space.ts +0 -202
  393. package/src/media-store/backup/watch.ts +0 -117
  394. package/src/review/band.ts +0 -182
  395. package/src/review/folders.ts +0 -216
  396. package/src/review/hook-ask.ts +0 -58
  397. package/src/review/role.ts +0 -48
  398. package/src/review/thread-fold.ts +0 -64
  399. package/src/review/wait.ts +0 -91
  400. package/src/rules/rule.ts +0 -43
  401. package/src/serve/hook-thread.ts +0 -37
  402. package/src/serve/hook-work.ts +0 -92
  403. package/src/serve/hook-worker.ts +0 -57
  404. package/src/serve/hub-app/review/dock.tsx +0 -147
  405. package/src/serve/hub-app/review/faces.tsx +0 -18
  406. package/src/serve/hub-app/review/item-verdict.tsx +0 -112
  407. package/src/serve/hub-app/review/review-board.tsx +0 -48
  408. /package/src/{scaffold → core}/jsonc-spans.ts +0 -0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,54 @@
1
+ ## 2.33.0
2
+
3
+ ### Added
4
+
5
+ - **`sk shot <url> --on <place>`**: a still or a clip shot by another machine of the house, its own browser, the file back at `--out`; a machine shipkit does not run on is refused with the reason.
6
+ - **Heavy work waits while the machine is full** and names who uses the CPU, by repo, process and session: at most 80 s, never in `sk bump`; `sk capacity` prints the same table, and the hub's held pill names the top user.
7
+ - **A question answers in question words**: each option picks, its pencil picks with a remark; under the options « none of these », « your call » (not on a confirm) and « no answer ». Versions keep the five tones.
8
+ - **Advisors see the hub's thread names, codes, groups, search and filters**: the users' port runs the hub's own list over the advisor's rows, and an advisor has a « since you left » line.
9
+
10
+ ### Changed
11
+
12
+ - **Browser checks follow the slow tests' rule**: a case whose only misses are waits under load runs again alone; passing alone it is a warning row in `.shipkit/cache/slow-tests.json`.
13
+ - **The daemon boots in 410 MB at its peak** (was 2.5 GB): the public clean check hashes only what npm packs, and the run record holds each check's newest runs.
14
+ - **The commit hooks do less**: the check table walks only when a unit file is staged, commit-msg loads its own gates.
15
+
16
+ ### Fixed
17
+
18
+ - **A click near the end of a thread is never lost**: the column keeps its distance from its end when a line measures again, an answer shows as given at the click, a failed send puts the value back.
19
+ - **A jump to a waiting question finds its line on a busy machine** and lands at once.
20
+
21
+ ## 2.32.0
22
+
23
+ ### Added
24
+
25
+ - **One thread state model** (`review/thread-state.ts`): whose turn, closed, owed and the holder read from one place, held by a verb by state table and a guard against any second computation.
26
+ - **Five tones in one answer bar** at the foot of a version or a question: ok, ok with a fix, rework, wrong direction, your call. A sixth quiet action, « no answer », takes the request off the owner's turn and wakes no agent.
27
+ - **Thread recaps**: `sk thread recap <address> --body <file>` (four checked sections) and `--offer`; once the owner accepts one, `show`, the inbox and the hub read from it, the history one click away.
28
+ - **Blocked commands as cards**: a command the auto mode classifier refused becomes a `blocked:` thread the owner allows in one click.
29
+ - **Threads move**: « move to project… » in a thread's head, `sk thread suggest-move`, and an old link opens the moved thread.
30
+ - **Picks**: `sk thread ask --row` asks one pick per thing, « none of these » ends every choice, option pictures draw small, and the lightbox compares a question's pictures with a side panel to pick from.
31
+ - **Advisors**: one users' port, a password reset by mail, a failed sign in in a red box.
32
+ - **`sk releases check`** names every problem of next.md in one run; `sk bump` reads it first.
33
+ - **Recordings**: arrows bend through points.
34
+
35
+ ### Changed
36
+
37
+ - **A test slow under load never blocks the gate or a release**: a timeout or a suite cut by the phase ceiling runs again alone; passing alone, it is one « slow under load » line and a row in `.shipkit/cache/slow-tests.json`.
38
+ - **A reply answers nothing an agent asked**: a question, a proposed change or a verdict request is answered in its own control only.
39
+ - **Any close moots what was asked before it**, whoever closed the thread.
40
+ - **Bookkeeping traces step back** and quiet runs fold into one line.
41
+ - **Hub speed in WebKit**: a thread heavy with pictures scrolls at 60 fps, pictures and avatars load at their size.
42
+
43
+ ### Removed
44
+
45
+ - `sk review`, `sk thread add`, `sk thread pick`, `post --choice`, `sk thread import|export|migrate`, `sk units`, `sk hq cards|door`, `sk advisors live`, the dispatcher role, the old `page:review` and `topic:` addresses, the root layout move, the store fold and the backup writer, with the one time readers of old files and names.
46
+
47
+ ### Fixed
48
+
49
+ - **A question's pictures on a thread the owner opened** draw in its options, never as his note's own image.
50
+ - **Advisors**: a password manager that fills the code field no longer blocks a set password; a thread brought back is a trace, never words in the owner's name.
51
+
1
52
  ## 2.31.0
2
53
 
3
54
  ### Added
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rvlib-shipkit",
3
- "version": "2.31.0",
3
+ "version": "2.33.0",
4
4
  "funding": "https://github.com/sponsors/rvion",
5
5
  "description": "All-in-one repo companion: ci gate (task DAG), auto-discovered health checks, release-contract fulfillness, asks queue, md-wiki tools, asset atelier, live tui",
6
6
  "license": "MIT",
@@ -3,14 +3,15 @@
3
3
  // A profile grants nothing, so an agent may prepare one; an agent's share waits for his confirm; every other act that
4
4
  // widens what leaves is his alone. A guard against a mistake, not a wall: a process of his user can write the file too
5
5
  import { randomBytes } from 'node:crypto'
6
- import { AGENT_ENV } from '../vault/vault-init.ts'
7
- import { appendMessage, readAll, storeDir } from '../review/store.ts'
6
+ import { AGENT_ENV } from '../core/agent-env.ts'
7
+ import { readAll, storeDir } from '../review/store.ts'
8
8
  import { snoozeThread } from '../review/snooze.ts'
9
- import { asideUntil, threadOfAddress, threadsOf, turnOf, type Thread } from '../review/threads.ts'
9
+ import { threadOfAddress, threadsOf, type Thread } from '../review/threads.ts'
10
10
  import { addressOrThrow, ownAddressOf } from '../review/model.ts'
11
11
  import { accessOf, advisorOf, isLive, profileOf, readState, withState, type Access, type Advisor, type OwnerState, type Share } from './owner-store.ts'
12
12
  import { DAYS_MAX, rightsOf, withLayer, type RightsScope } from './rights.ts'
13
13
  import { dropPhotoFiles } from './photos.ts'
14
+ import { asideRefusal, threadState } from '../review/thread-state.ts'
14
15
 
15
16
  /** who acts: the owner (the hub, his terminal), or an agent by its name */
16
17
  export type Actor = 'owner' | { agent: string }
@@ -159,17 +160,17 @@ const threadIn = (root: string, address: string): Thread | null => threadOfAddre
159
160
  function setAside(root: string, address: string, until: Date, now: Date): boolean {
160
161
  const t = threadIn(root, address)
161
162
  if (t === null) return false
162
- const turn = turnOf(t, now)
163
- if (turn !== 'yours' && turn !== 'aside') return false
163
+ if (asideRefusal(threadState(t, now)) !== null) return false
164
164
  snoozeThread(storeDir(root), t.head.item.id, { until, who: 'owner', now })
165
165
  return true
166
166
  }
167
167
 
168
- /** a thread still set aside comes back to his turn, with words that say why: a machine act in his name names its cause */
169
- export function bringBack(root: string, address: string, words: string, now = new Date()): boolean {
168
+ /** a thread still set aside comes back to his turn: a trace line, its cause the trace beside it (the share that ended,
169
+ * the advice that waits), never words in his name */
170
+ export function bringBack(root: string, address: string, now = new Date()): boolean {
170
171
  const t = threadIn(root, address)
171
- if (t === null || asideUntil(t, now) === null) return false
172
- appendMessage(storeDir(root), t.head.item.id, { who: 'owner', snooze: { until: null }, text: words }, { now })
172
+ if (t === null || (threadState(t, now).aside?.until ?? null) === null) return false
173
+ snoozeThread(storeDir(root), t.head.item.id, { until: null, who: 'owner', now })
173
174
  return true
174
175
  }
175
176
 
@@ -225,8 +226,8 @@ export function share(dir: string, o: { advisor: string; repo: string; root: str
225
226
  }
226
227
 
227
228
  /** his « add advisor » in a thread's head: a new person made first (`add`, or the one that email names), then the
228
- * share. `enable` is the old route's word, read and ignored: a share needs no other step */
229
- export function shareFromHead(dir: string, o: { advisor?: string; add?: { name: string; email: string }; repo: string; root: string; address: string; enable?: boolean; defer?: boolean }, actor: Actor, now = new Date()): Share {
229
+ * share */
230
+ export function shareFromHead(dir: string, o: { advisor?: string; add?: { name: string; email: string }; repo: string; root: string; address: string; defer?: boolean }, actor: Actor, now = new Date()): Share {
230
231
  ownerOnly(actor, 'sharing from a thread head')
231
232
  const email = o.add?.email.trim().toLowerCase()
232
233
  const known = email === undefined ? undefined : readState(dir).advisors.find((a) => a.email === email)
@@ -269,7 +270,7 @@ function revokeWhere(dir: string, pick: (x: Share, s: OwnerState) => boolean, no
269
270
  }
270
271
 
271
272
  const backAll = (ended: { share: Share; name: string }[], now: Date): void => {
272
- for (const { share: x, name } of ended) if (x.deferred) bringBack(x.root, x.address, `back from ${name}: no longer shared`, now)
273
+ for (const { share: x } of ended) if (x.deferred) bringBack(x.root, x.address, now)
273
274
  }
274
275
 
275
276
  /** unsharing narrows what leaves: anyone may, an agent too */
@@ -305,7 +306,7 @@ export function renew(dir: string, id: string, actor: Actor, now = new Date(), d
305
306
  })
306
307
  if (x.deferred) {
307
308
  const t = threadIn(x.root, x.address)
308
- if (t !== null && asideUntil(t, now) !== null) snoozeThread(storeDir(x.root), t.head.item.id, { until: new Date(x.expires), who: 'owner', now })
309
+ if (t !== null && (threadState(t, now).aside?.until ?? null) !== null) snoozeThread(storeDir(x.root), t.head.item.id, { until: new Date(x.expires), who: 'owner', now })
309
310
  }
310
311
  return x
311
312
  }
@@ -324,7 +325,7 @@ export function include(dir: string, o: { share: string; key: string; how: 'reda
324
325
  }
325
326
 
326
327
  /** a project's access that shows every thread (`see: all`): a live share made for each thread it does not share yet,
327
- * ending with the access. Each pass runs it before the push; its shares come from his act, never an agent's.
328
+ * ending with the access. The owner's pass runs it first; its shares come from the owner's act, never an agent's.
328
329
  * `between`: a test's stand in for another process's write between the read and the lock */
329
330
  export function shareAllOfAccess(dir: string, now = new Date(), between?: () => void): number {
330
331
  // the thread stores are read outside the lock; every want is checked again inside it, so an access ended or a
@@ -362,7 +363,7 @@ export function shareAllOfAccess(dir: string, now = new Date(), between?: () =>
362
363
  /** the person a thread is deferred to now: a live share he deferred, the thread still set aside. Never stored: his
363
364
  * reply or an agent's urgent word ends the aside, and the thread is his again */
364
365
  export function deferredTo(s: OwnerState, o: { repo: string; address: string; thread: Thread }, now = new Date()): Advisor | null {
365
- if (asideUntil(o.thread, now) === null) return null
366
+ if ((threadState(o.thread, now).aside?.until ?? null) === null) return null
366
367
  const x = s.shares.find((y) => y.repo === o.repo && y.address === o.address && y.deferred && isLive(y, now))
367
368
  return x === undefined ? null : (s.advisors.find((a) => a.id === x.advisor) ?? null)
368
369
  }
@@ -1,28 +1,29 @@
1
- // a person's answer on the Mac (wiki tools/shipkit/advisors.md, The advice): read from the bucket's inbox as hostile
2
- // input, kept pending outside the thread, so no agent wakes and no version settles; his confirm performs his own act,
3
- // his override sets it aside. A thread a person proposes waits the same way, and the files of either wait in the
4
- // bucket, quarantined, until he decides. What the person's rights make direct (advisors/rights.ts) skips the wait: it
5
- // lands under their name (their words, their answer, their verdict), never as his act
6
- // the one constraint a reader breaks first: nothing here writes a thread store before his click (confirm, accept) or
7
- // a direct right he wrote
1
+ // a person's answer on the Mac (wiki tools/shipkit/advisors.md, The advice): taken at the request on the users' port as
2
+ // hostile input, kept pending outside the thread, so no agent wakes and no version settles; the owner's confirm
3
+ // performs the owner's own act, the owner's override sets it aside. A thread a person proposes waits the same way, and
4
+ // the files of either wait in the port's folder, quarantined, until the owner decides. What the person's rights make
5
+ // direct (advisors/rights.ts) skips the wait: it lands under their name (their words, their answer, their verdict),
6
+ // never as the owner's act
7
+ // the one constraint a reader breaks first: nothing here writes a thread store before the owner's click (confirm,
8
+ // accept) or a direct right the owner wrote
8
9
  import { createHash } from 'node:crypto'
9
10
  import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs'
10
11
  import { verdictOf, type Origin, type ReviewItem, type Verdict } from '../review/model.ts'
11
12
  import { join } from 'node:path'
12
13
  import { addMessage, answerAsk, appendMessage, raiseItem, readAll, storeDir, writeVerdict } from '../review/store.ts'
13
14
  import { gateOf, rightsOf, type ActKind } from './rights.ts'
14
- import { membersOf, threadOfAddress, waits } from '../review/threads.ts'
15
+ import { membersOf, threadOfAddress } from '../review/threads.ts'
15
16
  import type { Bucket } from './edge/bucket.ts'
16
17
  import { cleanName, cleanType } from './edge/form.ts'
17
18
  import { ADVICE_KINDS, ADVICE_PENDING_MAX, ADVICE_PER_HOUR, ADVICE_TEXT_MAX, ENTRY_RE, FILE_MAX, FILE_NAME_MAX, FILES_MAX, KEYS, PROPOSAL_TITLE_MAX, PROPOSALS_PENDING_MAX, PROPOSALS_PER_HOUR, type AdviceKind } from './edge/types.ts'
18
19
  import { bringBack, newId, share, type Actor } from './acts.ts'
19
20
  import { talkKey } from '../orchestrator/talk-key.ts'
21
+ import { NO_TITLE, startTitle } from '../review/start-title.ts'
20
22
  import { opaqueItem, opaqueMessage, questionHash } from './project.ts'
21
23
  import { accessOf, isLive, startPlacesOf, readState, withState, type Advice, type OwnerState, type PendingFile, type Proposal, type Share } from './owner-store.ts'
24
+ import { threadState } from '../review/thread-state.ts'
22
25
 
23
- const INBOX_FILE_MAX = 8 * 1024
24
-
25
- /** the files an entry names, each as the door cleaned it; null for anything else */
26
+ /** the files an entry names, each as the users' port cleaned it; null for anything else */
26
27
  function filesOfWire(v: unknown): PendingFile[] | undefined | null {
27
28
  if (v === undefined) return undefined
28
29
  if (!Array.isArray(v) || v.length === 0 || v.length > FILES_MAX) return null
@@ -39,7 +40,7 @@ function filesOfWire(v: unknown): PendingFile[] | undefined | null {
39
40
  return out
40
41
  }
41
42
 
42
- /** an inbox object read with a strict schema: every field its type, nothing else kept; null for anything else */
43
+ /** an advice as sent, read with a strict schema: every field its type, nothing else kept; null for anything else */
43
44
  export function adviceOfWire(raw: unknown, expectEmail: string): Omit<Advice, 'id' | 'share' | 'advisor' | 'state'> | null {
44
45
  if (raw === null || typeof raw !== 'object' || Array.isArray(raw)) return null
45
46
  const r = raw as Record<string, unknown>
@@ -90,28 +91,11 @@ export function proposalOfWire(raw: unknown, expectEmail: string): Pick<Proposal
90
91
  return { at: r['at'], title: title.trim(), ...(typeof text === 'string' && text.trim() !== '' ? { text: text.trim() } : {}), ...(files !== undefined ? { files } : {}) }
91
92
  }
92
93
 
93
- /** an inbox object as json, null when absent, too big or not json */
94
- async function readEntry(bucket: Bucket, key: string): Promise<unknown> {
95
- const bytes = await bucket.get(key)
96
- if (bytes === null || bytes.byteLength > INBOX_FILE_MAX) return null
97
- try {
98
- return JSON.parse(new TextDecoder().decode(bytes))
99
- } catch {
100
- return null
101
- }
102
- }
103
-
104
- /** the entry of an inbox key, `<ms>-<random>`, null for any other name */
105
- const entryOf = (key: string): string | null => {
106
- const e = /\/([^/]+)\.json$/.exec(key)?.[1]
107
- return e !== undefined && ENTRY_RE.test(e) ? e : null
108
- }
109
-
110
94
  /** an upload no pending submission names leaves the bucket: a decided one at once, an unknown one (its record not
111
95
  * written yet) after an hour */
112
96
  const UPLOAD_GRACE_MS = 3_600_000
113
97
 
114
- async function sweepUploads(dir: string, bucket: Bucket, now: Date): Promise<void> {
98
+ export async function sweepUploads(dir: string, bucket: Bucket, now: Date): Promise<void> {
115
99
  const s = readState(dir)
116
100
  const pending = new Set<string>()
117
101
  const known = new Set<string>()
@@ -134,7 +118,7 @@ async function sweepUploads(dir: string, bucket: Bucket, now: Date): Promise<voi
134
118
  }
135
119
  }
136
120
 
137
- /** the store's ids behind the copy's ids of one share: an advice names what the advisor's page read */
121
+ /** the store's ids behind the view's ids of one share: an advice names what the advisor's page read */
138
122
  function idsOfShare(x: Share): Map<string, string> {
139
123
  const out = new Map<string, string>()
140
124
  const thread = threadOfAddress(x.address, readAll(storeDir(x.root)).items)
@@ -154,68 +138,13 @@ export function adviceInStore<T extends { item?: string; message?: string }>(w:
154
138
  return { ...w, ...(item !== undefined ? { item } : {}), ...(message !== undefined ? { message } : {}) }
155
139
  }
156
140
 
157
- /** each share's inbox read, kept pending, deleted from the bucket; a deferred thread still aside comes back. The
158
- * inbox of a share no longer live is emptied unread */
159
- export async function importAdvice(dir: string, bucket: Bucket, now = new Date()): Promise<Advice[]> {
141
+ /** each pending advice the person's rights make direct now (a right given since, a try that failed), into the thread;
142
+ * how many landed */
143
+ export async function deliverPending(dir: string, bucket: Bucket, now: Date): Promise<number> {
160
144
  const s = readState(dir)
161
- const got: Advice[] = []
162
- const drop: string[] = []
163
- const dropped: string[] = []
164
- for (const x of s.shares) {
165
- const keys = await bucket.list(KEYS.inbox(x.id))
166
- const a = s.advisors.find((y) => y.id === x.advisor)
167
- const ids = keys.length === 0 ? new Map<string, string>() : idsOfShare(x)
168
- for (const k of keys) {
169
- drop.push(k)
170
- const entry = entryOf(k)
171
- const mine = [...s.advice, ...got].filter((y) => y.share === x.id)
172
- const capped = mine.filter((y) => y.state === 'pending').length >= ADVICE_PENDING_MAX || mine.filter((y) => Date.parse(y.at) > now.getTime() - 3_600_000).length >= ADVICE_PER_HOUR
173
- const wire = x.state === 'live' && a !== undefined && !capped ? adviceOfWire(await readEntry(bucket, k), a.email) : null
174
- const w = wire === null ? null : adviceInStore(wire, ids)
175
- // an entry's name matters for its files alone: they wait under it
176
- if (w !== null && (w.files === undefined || entry !== null)) got.push({ id: newId(9), share: x.id, advisor: a!.id, state: 'pending', ...(entry !== null ? { entry } : {}), ...w })
177
- else if (entry !== null) dropped.push(KEYS.upload('s', x.id, entry))
178
- }
179
- }
180
- const proposed: Proposal[] = []
181
- // a thread comes by a door whose rights still let its person start one
182
- const byPropose = new Map(startPlacesOf(s, now).map((x) => [x.id, { ...x, propose: x.id }]))
183
- for (const k of await bucket.list('inbox/p/')) {
184
- drop.push(k)
185
- const pid = /^inbox\/p\/([A-Za-z0-9_-]{22})\//.exec(k)?.[1]
186
- const e = byPropose.get(pid ?? '')
187
- const a = e === undefined ? undefined : s.advisors.find((y) => y.id === e.advisor)
188
- const entry = entryOf(k)
189
- const w = a !== undefined && entry !== null ? proposalOfWire(await readEntry(bucket, k), a.email) : null
190
- // the door counts its inbox, which each pass empties: the caps that hold are counted here
191
- const mine = [...s.proposals, ...proposed].filter((p) => p.propose === pid)
192
- const capped = mine.filter((p) => p.state === 'pending').length >= PROPOSALS_PENDING_MAX || mine.filter((p) => Date.parse(p.at) > now.getTime() - 3_600_000).length >= PROPOSALS_PER_HOUR
193
- if (w !== null && !capped) proposed.push({ id: newId(9), advisor: a!.id, repo: e!.repo, root: e!.root, propose: e!.propose!, entry: entry!, state: 'pending', ...w })
194
- else if (pid !== undefined && entry !== null) dropped.push(KEYS.upload('p', pid, entry))
195
- }
196
- if (got.length > 0 || proposed.length > 0)
197
- withState(dir, (st) => {
198
- st.advice.push(...got)
199
- st.proposals.push(...proposed)
200
- })
201
- for (const k of drop) await bucket.delete(k)
202
- // the files of an entry read and refused, or of a share or project no longer open, leave with it
203
- for (const prefix of dropped) for (const k of await bucket.list(prefix)) await bucket.delete(k)
204
- await settle(dir, bucket, s, got, now)
205
- // a pending one of an earlier pass the person's rights make direct now (a right given since, a pass that failed)
206
- const fresh = new Set(got.map((g) => g.id))
207
- const later = readState(dir)
208
- for (const g of later.advice) if (g.state === 'pending' && !fresh.has(g.id)) await deliverDirect(dir, bucket, later, g, now)
209
- for (const p of proposed) {
210
- if (gateOf(rightsOf(s.rights, { person: p.advisor, project: p.repo }), 'newThread', (p.files ?? []).length > 0) !== 'direct') continue
211
- try {
212
- await openProposal(dir, p.id, 'direct', bucket, now)
213
- } catch {
214
- // left pending for his accept
215
- }
216
- }
217
- await sweepUploads(dir, bucket, now)
218
- return got
145
+ let n = 0
146
+ for (const g of s.advice) if (g.state === 'pending' && (await deliverDirect(dir, bucket, s, g, now))) n++
147
+ return n
219
148
  }
220
149
 
221
150
  /** a pending advice the person's rights make direct, into the thread now: true once it landed. A direct pick on a
@@ -254,15 +183,14 @@ async function settle(dir: string, bucket: Bucket, s: OwnerState, got: readonly
254
183
  // a direct word is on his side of the thread already: it ends the aside by itself
255
184
  if (!x.deferred || back.has(x.id) || delivered.has(g.id)) continue
256
185
  back.add(x.id)
257
- const name = s.advisors.find((y) => y.id === x.advisor)?.name ?? 'the advisor'
258
- bringBack(x.root, x.address, `${name} answered: the advice waits for you`, now)
186
+ bringBack(x.root, x.address, now)
259
187
  }
260
188
  return delivered
261
189
  }
262
190
 
263
- /** one advice a user sent on the users' port, taken at the request: read with the inbox's strict schema, counted
264
- * against the same caps, kept pending in his store, then settled as an imported one. `entry` names where its files
265
- * wait (KEYS.upload) */
191
+ /** one advice a user sent on the users' port, taken at the request: read with its strict schema (adviceOfWire),
192
+ * counted against the caps, kept pending in the owner's store, then settled. `entry` names where its files wait
193
+ * (KEYS.upload) */
266
194
  export async function landAdvice(dir: string, bucket: Bucket, share: string, raw: unknown, entry: string, now = new Date()): Promise<{ waits: boolean } | { status: number; error: string }> {
267
195
  const s = readState(dir)
268
196
  const x = s.shares.find((y) => y.id === share)
@@ -280,6 +208,30 @@ export async function landAdvice(dir: string, bucket: Bucket, share: string, raw
280
208
  return { waits: !delivered.has(g.id) }
281
209
  }
282
210
 
211
+ /** a thread a user proposes on the users' port, taken at the request: read with its strict schema (proposalOfWire),
212
+ * counted against the caps, kept pending in the owner's store, opened at once when the person's rights make it direct.
213
+ * `place` is the start place's id (startPlacesOf), `entry` names where its files wait (KEYS.upload) */
214
+ export async function landProposal(dir: string, bucket: Bucket, place: string, raw: unknown, entry: string, now = new Date()): Promise<{ waits: boolean } | { status: number; error: string }> {
215
+ const s = readState(dir)
216
+ const e = startPlacesOf(s, now).find((x) => x.id === place)
217
+ const a = e === undefined ? undefined : s.advisors.find((y) => y.id === e.advisor)
218
+ if (e === undefined || a === undefined) return { status: 404, error: 'no such project' }
219
+ const mine = s.proposals.filter((p) => p.propose === place)
220
+ if (mine.filter((p) => p.state === 'pending').length >= PROPOSALS_PENDING_MAX || mine.filter((p) => Date.parse(p.at) > now.getTime() - 3_600_000).length >= PROPOSALS_PER_HOUR) return { status: 429, error: 'enough new threads for now: try again in an hour' }
221
+ const w = proposalOfWire(raw, a.email)
222
+ if (w === null) return { status: 400, error: 'this is not a thread to start' }
223
+ const p: Proposal = { id: newId(9), advisor: a.id, repo: e.repo, root: e.root, propose: place, entry, state: 'pending', ...w }
224
+ withState(dir, (st) => void st.proposals.push(p))
225
+ if (gateOf(rightsOf(s.rights, { person: p.advisor, project: p.repo }), 'newThread', (p.files ?? []).length > 0) !== 'direct') return { waits: true }
226
+ try {
227
+ await openProposal(dir, p.id, 'direct', bucket, now)
228
+ return { waits: false }
229
+ } catch {
230
+ // left pending for his accept
231
+ return { waits: true }
232
+ }
233
+ }
234
+
283
235
  const adviceIn = (s: OwnerState, id: string): { a: Advice; x: Share; name: string } => {
284
236
  const a = s.advice.find((y) => y.id === id)
285
237
  if (a === undefined) throw new Error(`no advice ${id}`)
@@ -317,7 +269,7 @@ export function staleWhy(a: Advice, x: Share): string | null {
317
269
  }
318
270
  if (it.item.views.length !== a.version) return 'the version changed since the advisor read it'
319
271
  // the person's own direct verdict never makes theirs stale: a new one is them changing their mind
320
- if (!waits(it) && theirVerdict(it, a.advisor) === null) return STALE_JUDGED
272
+ if (!(it === t.head && threadState(t).headWaits) && theirVerdict(it, a.advisor) === null) return STALE_JUDGED
321
273
  return null
322
274
  }
323
275
 
@@ -440,8 +392,8 @@ export interface LocalFile {
440
392
  name: string
441
393
  }
442
394
 
443
- /** the files of a submission out of the bucket into a folder of the Mac's own (0700), each checked against what its
444
- * entry said; `done` removes the folder. Only his accept calls it */
395
+ /** the files of a submission out of the port's folder into a folder of the Mac's own (0700), each checked against what
396
+ * its entry said; `done` removes the folder. Only the owner's accept calls it */
445
397
  export async function fetchQuarantined(dir: string, bucket: Bucket, o: { scope: 's' | 'p'; id: string; entry: string; files: readonly PendingFile[] }): Promise<{ files: LocalFile[]; keys: string[]; done: () => void }> {
446
398
  mkdirSync(dir, { recursive: true, mode: 0o700 })
447
399
  const tmp = mkdtempSync(join(dir, 'accept-'))
@@ -515,7 +467,9 @@ async function openProposal(dir: string, id: string, how: 'owner' | 'direct', bu
515
467
  try {
516
468
  const store = storeDir(p.root)
517
469
  const items = readAll(store).items
518
- const base = talkKey(p.title, now)
470
+ // a start with only files, from a page that named it « a new thread »: its first file names it
471
+ const title = startTitle(p.title === NO_TITLE ? '' : p.title, p.text ?? '', files)
472
+ const base = talkKey(title, now)
519
473
  let key = base
520
474
  for (let n = 2; threadOfAddress(`talk:${key}`, items) !== null; n++) key = `${base}-${n}`
521
475
  // his accept raises it as his own; a direct open names the person, a word from outside as a player's report is
@@ -524,7 +478,7 @@ async function openProposal(dir: string, id: string, how: 'owner' | 'direct', bu
524
478
  how === 'owner'
525
479
  ? { by: 'owner', from: 'advisors' }
526
480
  : { by: 'player', player: name, server: 'advisors', serverId: Number.parseInt(createHash('sha256').update(p.id).digest('hex').slice(0, 12), 16), client: 'the advisors page', context: { advisor: p.advisor, proposal: p.id } }
527
- const x = await raiseItem(store, { subject: { kind: 'object', address: `talk:${key}` }, origin, title: p.title, what: `proposed by ${name}, an advisor`, now })
481
+ const x = await raiseItem(store, { subject: { kind: 'object', address: `talk:${key}` }, origin, title, what: `proposed by ${name}, an advisor`, now })
528
482
  const words = p.text !== undefined ? `${name} proposes: ${p.text}` : `${name} proposes it`
529
483
  if (how === 'owner') addMessage(store, x.item.id, 'owner', words, undefined, now, undefined, got !== null ? got.files : undefined)
530
484
  else appendMessage(store, x.item.id, { who: 'player', text: words, advisor: { id: p.advisor, name } }, { now, ...(got !== null ? { files: got.files } : {}) })